import { Component, OnInit } from '@angular/core';
import { JsonApiService } from "app/core/api/json-api.service"; //http请求配置引入
import { Router, ActivatedRoute } from "@angular/router"; //路由引入
import { config } from '../../shared/smartadmin.config';

declare var $: any;
declare var Viewer: any;
@Component({
	selector: 'sa-sample-image',
	templateUrl: './sample-image.component.html',
	styleUrls: ['./sample-image.css']
})
export class SampleImageComponent implements OnInit {
	tableData: any[] = []; //table数据
	totalCount: number = 0; //分页总条数
	curPage: number = 1; //分页当前页
	pageSize: number = 10; //内置的分页每页条数
	tableParam: any = {
		searchKey: '',
		carType: ''
	}
	isViewer: boolean = false; //默认隐藏
	isShowDelete = true; // 默认不显示删除按钮
	carTypeName: any = '' //弹窗名字
	formType:any= '新增' //添加还是编辑
	constructor(private jsonApiService: JsonApiService, private router: Router, private activatedRoute: ActivatedRoute) {
		activatedRoute.queryParams.subscribe(queryParams => {
			this.curPage = queryParams.nowPage || 1;
		});
	}
	ngOnInit() {
		this.initBtn();
		this.load();
	}
	//初始化权限按钮
	initBtn() {
		// 公司的删除按钮的权限
		// var btnData = JSON.parse(decodeURIComponent(localStorage.getItem('cargpsw_wx:bind:adviseLog')));
		// if(!btnData) {
		// 	return
		// };
		// for(let item of btnData) {
		// 	if(item.sourceKey === "wx-bind:advise-log:deleteBtn" && item.parentId) {
		// 		this.isShowDelete = true;
		// 	}
		// }
	}
	//table刷新
	refresh() {
		this.load();
	}
	//表格搜索
	tableSearch() {
		this.curPage = 1;
		this.load();
	}
	//分页回调
	paginate(e) {
		this.curPage = e.page + 1;
		this.pageSize = e.rows;
		this.load();
	}
	//初始化加载list数据
	load() {
		let data = {
			pageSize: this.pageSize,
			nowPage: this.curPage,
			parameters: {
				searchKey: common.stringTrim(this.tableParam.searchKey),
				useTypeL2: this.tableParam.carType
			}
		}
		let reqdata = 'gridPager=' + JSON.stringify(data);
		this.jsonApiService.http("figure/list.html", reqdata).subscribe(result => {
			if (result.isSuccess && result.exhibitDatas) {
				for(var i=0;i< result.exhibitDatas.length;i++){
					if(result.exhibitDatas[i].useTypeL2 == '0211'){
						result.exhibitDatas[i].useTypeName = '后挂双桶'
					}else if(result.exhibitDatas[i].useTypeL2 == '0214'){
						result.exhibitDatas[i].useTypeName = '侧挂拉杆'
					}else if(result.exhibitDatas[i].useTypeL2 == '0213'){
						result.exhibitDatas[i].useTypeName = '侧挂链条'
					}
					
				}
				this.tableData = result.exhibitDatas
				this.totalCount = result.recordCount;
			}
		});
	}
	// 删除登录日志
	deleteRow(row) {
		this.jsonApiService.confirm_message("此操作将永久删除数据,确认要删除?").then(() => {
			let parameters = {
				id: row.id,
			}
			this.jsonApiService.http_obj("figure/deletedById.html", parameters).subscribe(data => {
				this.jsonApiService.message(data.message);
				this.tableParam.carType = ''
				this.load();
			})
		})
	}
	//后挂双桶
	carDoubleList: any=[
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "车牌号",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "车头品牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "车辆铭牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "车尾品牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "车尾架子",
							"prefix":""
						},
					],
					"index": 1,
					"isShow": 0,
					"name": "车辆信息"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "圆轴底到下端顶",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "左铁架内高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "左挂齿到下端底",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "左挂齿总长度",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "下横梁高度",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "上横梁高度",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 7,
							"name": "左端到第2竖梁",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 8,
							"name": "第2竖梁到第3竖梁",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 9,
							"name": "第3竖梁到右端",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 10,
							"name": "底部宽度",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 11,
							"name": "顶部宽度",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 12,
							"name": "圆轴表面到外表面",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 13,
							"name": "圆轴表面到上横梁",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 14,
							"name": "圆轴表面到下横梁",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "后挂信息"
				},
			],
			"index": 1,
			"name": "原车信息",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "主机照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "主机电源线接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "GPS接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "GPRS接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "天线位置",
							"prefix":""
						},
					],
					"index": 1,
					"isShow": 1,
					"name": "主机接线"
				}
			],
			"index": 2,
			"name": "主机接线",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "左竖梁左侧到左侧边缘",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "左竖梁上端第1孔位到顶端距离",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "左竖梁上端第1孔位到底端距离",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "右竖梁左侧到左侧边缘",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "右竖梁上端第1孔位到顶端距离",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "右竖梁上端第1孔位到底端距离",
							"prefix":""
						},
					],
					"index": 1,
					"isShow": 0,
					"name": "竖梁位置"
				},{
					"figureImageEntities": [{
							"figureImageList": [
								{
									"imageUrl": "",
									"index": 1,
									"name": "竖梁左上",
									"prefix":"左挂前"
								},
								{
									"imageUrl": "",
									"index": 2,
									"name": "竖梁右上",
									"prefix":"左挂前"
								},
								{
									"imageUrl": "",
									"index": 3,
									"name": "竖梁左下",
									"prefix":"左挂前"
								},
								{
									"imageUrl": "",
									"index": 4,
									"name": "竖梁右下",
									"prefix":"左挂前"
								}
							],
							"index": 1,
							"name": "左挂前"
						},{
							"figureImageList": [
								{
									"imageUrl": "",
									"index": 5,
									"name": "竖梁左上",
									"prefix":"右挂前"
								},
								{
									"imageUrl": "",
									"index": 6,
									"name": "竖梁右上",
									"prefix":"右挂前"
								},
								{
									"imageUrl": "",
									"index": 7,
									"name": "竖梁左下",
									"prefix":"右挂前"
								},
								{
									"imageUrl": "",
									"index": 8,
									"name": "竖梁右下",
									"prefix":"右挂前"
								}
							],
							"index": 2,
							"name": "右挂前"
						},{
							"figureImageList": [
								{
									"imageUrl": "",
									"index": 9,
									"name": "竖梁左上",
									"prefix":"左挂后"
								},
								{
									"imageUrl": "",
									"index": 10,
									"name": "竖梁右上",
									"prefix":"左挂后"
								},
								{
									"imageUrl": "",
									"index": 11,
									"name": "竖梁左下",
									"prefix":"左挂后"
								},
								{
									"imageUrl": "",
									"index": 12,
									"name": "竖梁右下",
									"prefix":"左挂后"
								}
							],
							"index": 3,
							"name": "左挂后"
						},{
							"figureImageList": [
								{
									"imageUrl": "",
									"index": 13,
									"name": "竖梁左上",
									"prefix":"右挂后"
								},
								{
									"imageUrl": "",
									"index": 14,
									"name": "竖梁右上",
									"prefix":"右挂后"
								},
								{
									"imageUrl": "",
									"index": 15,
									"name": "竖梁左下",
									"prefix":"右挂后"
								},
								{
									"imageUrl": "",
									"index": 16,
									"name": "竖梁右下",
									"prefix":"右挂后"
								}
							],
							"index": 4,
							"name": "右挂后"
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 3,
			"name": "竖梁焊接",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "左铁板焊接完",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "右铁板焊接完",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "铁板焊接"
				},{
					"figureImageEntities": [
						{
							"figureImageList": [{
								"imageUrl": "",
								"index": 1,
								"name": "挡板左端到铁板左端",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 2,
								"name": "挡板上端到铁板上端（不含挂齿）",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 3,
								"name": "挡板左端到铁板右端",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 4,
								"name": "挡板上端到铁板下端",
								"prefix":"左铁板"
							}],
							"index": 1,
							"name": "左铁板"
						},{
							"figureImageList": [{
								"imageUrl": "",
								"index": 1,
								"name": "挡板左端到铁板左端",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 2,
								"name": "挡板上端到铁板上端（不含挂齿）",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 3,
								"name": "挡板左端到铁板右端",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 4,
								"name": "挡板上端到铁板下端",
								"prefix":"右铁板"
							}],
							"index": 2,
							"name": "右铁板"
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "挡板位置"
				},{
					"figureImageEntities": [
						{
							"figureImageList": [{
								"imageUrl": "",
								"index": 1,
								"name": "挡板左",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 2,
								"name": "挡板右",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 3,
								"name": "挡板上",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 4,
								"name": "挡板下",
								"prefix":"左铁板"
							}],
							"index": 2,
							"name": "左铁板"
						},
						{
							"figureImageList": [{
								"imageUrl": "",
								"index": 5,
								"name": "挡板左",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 6,
								"name": "挡板右",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 7,
								"name": "挡板上",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 8,
								"name": "挡板下",
								"prefix":"右铁板"
							}],
							"index": 2,
							"name": "右铁板"
						}
					],
					"index": 3,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 4,
			"name": "铁板焊接",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "左铁板传感器安装整体",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "右铁板传感器安装整体",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "传感器"
				},{
					"figureImageEntities": [
						{
						"figureImageList": [{
								"imageUrl": "",
								"index": 1,
								"name": "挂齿与压桶板距离",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 2,
								"name": "铁板上端左间隙",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 3,
								"name": "铁板上端右间隙",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 4,
								"name": "铁板下端左间隙",
								"prefix":"左铁板"
							},{
								"imageUrl": "",
								"index": 5,
								"name": "铁板下端右间隙",
								"prefix":"左铁板"
							}],
							"index": 1,
							"name": "左铁板"
						},
						{
							"figureImageList": [{
								"imageUrl": "",
								"index": 6,
								"name": "挂齿与压桶板距离",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 7,
								"name": "铁板上端左间隙",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 8,
								"name": "铁板上端右间隙",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 9,
								"name": "铁板下端左间隙",
								"prefix":"右铁板"
							},{
								"imageUrl": "",
								"index": 10,
								"name": "铁板下端右间隙",
								"prefix":"右铁板"
							}
						],
						"index":2,
						"name": "右铁板"
					}],
					"index": 2,
					"isShow": 0,
					"name": "安装位置"
				}
			],
			"index": 5,
			"name": "传感器",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "磁铁处打磨",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "磁铁打胶",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "接近开关"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "焊接点1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "焊接点2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "焊接点3",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 6,
			"name": "接近开关",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "效果图",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "显示器"
				}
			],
			"index": 7,
			"name": "显示器",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体-左",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "整体-右",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "读卡器"
				},{
					"figureImageEntities": [
						{
						"figureImageList": [{
							"imageUrl": "",
							"index": 1,
							"name": "左",
							"prefix":"左读卡器"
						},{
							"imageUrl": "",
							"index": 2,
							"name": "右",
							"prefix":"左读卡器"
						},{
							"imageUrl": "",
							"index": 3,
							"name": "上",
							"prefix":"左读卡器"
						}
					],
					"index":1,
					"name": "左读卡器"
					},{
						"figureImageList": [{
							"imageUrl": "",
							"index": 4,
							"name": "左",
							"prefix":"右读卡器"
						},{
							"imageUrl": "",
							"index": 5,
							"name": "右",
							"prefix":"右读卡器"
						},{
							"imageUrl": "",
							"index": 6,
							"name": "上",
							"prefix":"右读卡器"
						}
					],
					"index":2,
					"name": "右读卡器"
					}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 8,
			"name": "读卡器",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "位置1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "位置2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "位置3",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "位置4",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "位置5",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "走线"
				}
			],
			"index": 9,
			"name": "走线",
			"useTypeL2": "0211",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "接近开关1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "接近开关2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "传感器1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "传感器2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "读卡器1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "读卡器2",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "破线"
				}
			],
			"index": 10,
			"name": "破线",
			"useTypeL2": "0211",
			'id':''
		},
	]
	//侧挂拉杆
	carSideList: any=[
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "车牌号",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "车头品牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "车辆铭牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "车尾架子",
							"prefix":""
						},
					],
					"index": 1,
					"isShow": 0,
					"name": "车辆信息"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "铁架内高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "上横梁顶到下底高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "挂齿顶到下底高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "压板底到下底高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "挂齿总长度",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "铁板左到右长度",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "侧挂信息"
				},
			],
			"index": 1,
			"name": "原车信息",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "主机照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "主机电源线接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "GPS接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "GPRS接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "天线位置",
							"prefix":""
						},
					],
					"index": 1,
					"isShow": 1,
					"name": "主机接线"
				}
			],
			"index": 2,
			"name": "主机接线",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "竖梁左侧到左侧边缘",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "竖梁上端第1孔位到顶端距离",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "竖梁上端第1孔位到底端距离",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 0,
					"name": "竖梁位置"
				},{
					"figureImageEntities": [{
						"figureImageList": [{
							"imageUrl": "",
							"index": 1,
							"name": "竖梁左上",
							"prefix":"侧挂前"
						},{
							"imageUrl": "",
							"index": 2,
							"name": "竖梁右上",
							"prefix":"侧挂前"
						},{
							"imageUrl": "",
							"index": 3,
							"name": "竖梁左下",
							"prefix":"侧挂前"
						},{
							"imageUrl": "",
							"index": 4,
							"name": "竖梁右下",
							"prefix":"侧挂前"
						}
					],
					"index":1,
					"name": "侧挂前"
					},{
						"figureImageList": [{
							"imageUrl": "",
							"index": 5,
							"name": "竖梁左上",
							"prefix":"侧挂后"
						},{
							"imageUrl": "",
							"index": 6,
							"name": "竖梁右上",
							"prefix":"侧挂后"
						},{
							"imageUrl": "",
							"index": 7,
							"name": "竖梁左下",
							"prefix":"侧挂后"
						},{
							"imageUrl": "",
							"index": 8,
							"name": "竖梁右下",
							"prefix":"侧挂后"
						}
					],
						"index":2,
						"name": "侧挂后"
					}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 3,
			"name": "竖梁焊接",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "铁板焊接完",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "铁板焊接"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "挡板左端到铁板左端",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "挡板左端到铁板右端",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "挡板上端到铁板上端（不含挂齿）",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "挡板上端到铁板下端",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "挡板位置"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "挡板左",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "挡板右",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "挡板上",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "挡板下",
							"prefix":""
						}
					],
					"index": 3,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 4,
			"name": "铁板焊接",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "铁板传感器安装整体",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "传感器"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "挂齿与压桶板距离",
							"prefix":"左铁板"
						},{
							"imageUrl": "",
							"index": 2,
							"name": "铁板上端左间隙",
							"prefix":"左铁板"
						},{
							"imageUrl": "",
							"index": 3,
							"name": "铁板上端右间隙",
							"prefix":"左铁板"
						},{
							"imageUrl": "",
							"index": 4,
							"name": "铁板下端左间隙",
							"prefix":"左铁板"
						},{
							"imageUrl": "",
							"index": 5,
							"name": "铁板下端右间隙",
							"prefix":"左铁板"
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "安装位置"
				}
			],
			"index": 5,
			"name": "传感器",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "磁铁处打磨",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "磁铁打胶",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "接近开关"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "焊接点1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "焊接点2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "焊接点3",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 6,
			"name": "接近开关",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "效果图",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "显示器"
				}
			],
			"index": 7,
			"name": "显示器",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "读卡器"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "左",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "右",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "上",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 8,
			"name": "读卡器",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "位置1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "位置2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "位置3",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "位置4",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "位置5",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "走线"
				}
			],
			"index": 9,
			"name": "走线",
			"useTypeL2": "0214",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "接近开关1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "接近开关2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "传感器1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "传感器2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "读卡器1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "读卡器2",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "破线"
				}
			],
			"index": 10,
			"name": "破线",
			"useTypeL2": "0214",
			'id':''
		},
	]
	//侧挂链条
	carChainList: any=[
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "车牌号",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "车头品牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "车辆铭牌",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "车尾架子",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "铁板到链条距离",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "链条宽度",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 0,
					"name": "车辆信息"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "横梁从左到右",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "挂齿顶到下底高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "挂齿顶到下横梁底",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "压板底面到下底高",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "铁板左到右长度",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "侧挂信息"
				},
			],
			"index": 1,
			"name": "原车信息",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "主机照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "主机电源线接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "GPS接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "GPRS接线",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "天线位置",
							"prefix":""
						},
					],
					"index": 1,
					"isShow": 1,
					"name": "主机接线"
				}
			],
			"index": 2,
			"name": "主机接线",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "横梁焊接"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "焊接点1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "焊接点2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "焊接点3",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "焊接点4",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "焊接点5",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "焊接点6",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 3,
			"name": "横梁焊接",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "传感器安装整体",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "铁板安装整体",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "传感器"
				}
			],
			"index": 4,
			"name": "传感器",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "位置1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "位置2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "位置3",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "位置4",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 6,
							"name": "位置5",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "链条走线"
				}
			],
			"index": 5,
			"name": "链条走线",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "磁铁打胶",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "主机端线序",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "接近开关"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "焊接点1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "焊接点2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "焊接点3",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 6,
			"name": "接近开关",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "整体照片",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "读卡器"
				},{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "焊接点1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "焊接点2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "焊接点3",
							"prefix":""
						}
					],
					"index": 2,
					"isShow": 0,
					"name": "虚焊检查"
				}
			],
			"index": 7,
			"name": "读卡器",
			"useTypeL2": "0213",
			'id':''
		},
		{
			"figureSubsetEntities": [{
					"figureImageEntities": [{
							"imageUrl": "",
							"index": 1,
							"name": "接近开关1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 2,
							"name": "接近开关2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 3,
							"name": "传感器1",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 4,
							"name": "传感器2",
							"prefix":""
						},{
							"imageUrl": "",
							"index": 5,
							"name": "读卡器",
							"prefix":""
						}
					],
					"index": 1,
					"isShow": 1,
					"name": "破线"
				}
			],
			"index": 8,
			"name": "破线",
			"useTypeL2": "0213",
			'id':''
		},
	]

	carDataListShow: any=[];
	rowId :any = '';
	rowUseTypeL2: any = ''
	// 添加公司弹框
	addCompany(row,modal,type) {
		this.carDataListShow = [];
		this.rowId = '';
		if(!this.tableParam.carType && type == '1'){
			this.jsonApiService.message('请先选择车型');
			return
		}
		
		if(type == '1'){
			this.formType = '新增';
			if(this.tableParam.carType == '0211'){
				this.carTypeName = '后挂双桶';
				this.carDataListShow = JSON.parse(JSON.stringify(this.carDoubleList))
			}else if(this.tableParam.carType == '0214'){
				this.carTypeName = '侧挂拉杆';
				this.carDataListShow =  JSON.parse(JSON.stringify(this.carSideList))
			}else if(this.tableParam.carType == '0213'){
				this.carTypeName = '侧挂链条'
				this.carDataListShow =  JSON.parse(JSON.stringify(this.carChainList))
			}

			this.rowUseTypeL2 = this.tableParam.carType
		}else if(type == '2'){
			this.formType = '编辑';
			//请求示例图
			if(row.useTypeL2 == '0211'){
				this.carTypeName = '后挂双桶';
			}else if(row.useTypeL2 == '0214'){
				this.carTypeName = '侧挂拉杆';
			}else if(row.useTypeL2 == '0213'){
				this.carTypeName = '侧挂链条'
			}
			this.exampleDiagram(row)
			this.rowId = row.id;
			this.rowUseTypeL2 = row.useTypeL2;
		}
		
		if(this.isViewer && $(".viewer-container").length >0){
			this.viewer.destroy();
		}

		modal.show();
	}
	exampleDiagram(row){
		this.jsonApiService.http_obj("figure/figureDetail.html", {useTypeL2: row.useTypeL2}).subscribe(data => {
			if(row.useTypeL2 == '0213'){
				this.carDataListShow = JSON.parse(JSON.stringify(data.data))
			}else{
				var carDataListShowList = JSON.parse(JSON.stringify(data.data));
				var carDataListShowData
				if(row.useTypeL2 == '0211'){
					carDataListShowData = JSON.parse(JSON.stringify(this.carDoubleList));

					carDataListShowData[0] = JSON.parse(JSON.stringify(carDataListShowList[0]));
					carDataListShowData[1] = JSON.parse(JSON.stringify(carDataListShowList[1]));
					carDataListShowData[2].id = carDataListShowList[2].id
					carDataListShowData[2].figureSubsetEntities[0] = JSON.parse(JSON.stringify(carDataListShowList[2].figureSubsetEntities[0]));
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[0].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[0].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[1].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[1].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[2].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[2].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[3].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[3].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[0].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[4].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[1].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[5].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[2].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[6].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[3].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[7].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[2].figureImageList[0].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[8].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[2].figureImageList[1].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[9].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[2].figureImageList[2].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[10].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[2].figureImageList[3].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[11].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[3].figureImageList[0].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[12].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[3].figureImageList[1].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[13].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[3].figureImageList[2].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[14].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[3].figureImageList[3].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[15].imageUrl
					
					carDataListShowData[3].id = carDataListShowList[3].id
					carDataListShowData[3].figureSubsetEntities[0] = JSON.parse(JSON.stringify(carDataListShowList[3].figureSubsetEntities[0]));
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[0].figureImageList[0].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[0].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[0].figureImageList[1].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[1].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[0].figureImageList[2].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[2].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[0].figureImageList[3].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[3].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[1].figureImageList[0].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[4].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[1].figureImageList[1].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[5].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[1].figureImageList[2].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[6].imageUrl
					carDataListShowData[3].figureSubsetEntities[1].figureImageEntities[1].figureImageList[3].imageUrl = carDataListShowList[3].figureSubsetEntities[1].figureImageEntities[7].imageUrl

					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[0].figureImageList[0].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[0].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[0].figureImageList[1].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[1].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[0].figureImageList[2].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[2].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[0].figureImageList[3].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[3].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[1].figureImageList[0].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[4].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[1].figureImageList[1].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[5].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[1].figureImageList[2].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[6].imageUrl
					carDataListShowData[3].figureSubsetEntities[2].figureImageEntities[1].figureImageList[3].imageUrl = carDataListShowList[3].figureSubsetEntities[2].figureImageEntities[7].imageUrl

					carDataListShowData[4].id = carDataListShowList[4].id
					carDataListShowData[4].figureSubsetEntities[0] = JSON.parse(JSON.stringify(carDataListShowList[4].figureSubsetEntities[0]));
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[0].figureImageList[0].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[0].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[0].figureImageList[1].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[1].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[0].figureImageList[2].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[2].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[0].figureImageList[3].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[3].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[0].figureImageList[4].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[4].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[1].figureImageList[0].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[5].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[1].figureImageList[1].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[6].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[1].figureImageList[2].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[7].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[1].figureImageList[3].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[8].imageUrl
					carDataListShowData[4].figureSubsetEntities[1].figureImageEntities[1].figureImageList[4].imageUrl = carDataListShowList[4].figureSubsetEntities[1].figureImageEntities[9].imageUrl

					carDataListShowData[5] = JSON.parse(JSON.stringify(carDataListShowList[5]));
					carDataListShowData[6] = JSON.parse(JSON.stringify(carDataListShowList[6]));
					carDataListShowData[7].id = carDataListShowList[7].id
					carDataListShowData[7].figureSubsetEntities[0] = carDataListShowList[7].figureSubsetEntities[0] ;
					carDataListShowData[7].figureSubsetEntities[1].figureImageEntities[0].figureImageList[0].imageUrl = carDataListShowList[7].figureSubsetEntities[1].figureImageEntities[0].imageUrl
					carDataListShowData[7].figureSubsetEntities[1].figureImageEntities[0].figureImageList[1].imageUrl = carDataListShowList[7].figureSubsetEntities[1].figureImageEntities[1].imageUrl
					carDataListShowData[7].figureSubsetEntities[1].figureImageEntities[0].figureImageList[2].imageUrl = carDataListShowList[7].figureSubsetEntities[1].figureImageEntities[2].imageUrl
					carDataListShowData[7].figureSubsetEntities[1].figureImageEntities[1].figureImageList[0].imageUrl = carDataListShowList[7].figureSubsetEntities[1].figureImageEntities[3].imageUrl
					carDataListShowData[7].figureSubsetEntities[1].figureImageEntities[1].figureImageList[1].imageUrl = carDataListShowList[7].figureSubsetEntities[1].figureImageEntities[4].imageUrl
					carDataListShowData[7].figureSubsetEntities[1].figureImageEntities[1].figureImageList[2].imageUrl = carDataListShowList[7].figureSubsetEntities[1].figureImageEntities[5].imageUrl
					
					carDataListShowData[8] = JSON.parse(JSON.stringify(carDataListShowList[8]));
					carDataListShowData[9] = JSON.parse(JSON.stringify(carDataListShowList[9]));
				}else if(row.useTypeL2 == '0214'){
					carDataListShowData = JSON.parse(JSON.stringify(this.carSideList));

					carDataListShowData[0] = JSON.parse(JSON.stringify(carDataListShowList[0]));
					carDataListShowData[1] = JSON.parse(JSON.stringify(carDataListShowList[1]));
					carDataListShowData[2].id = carDataListShowList[2].id
					carDataListShowData[2].figureSubsetEntities[0] = JSON.parse(JSON.stringify(carDataListShowList[2].figureSubsetEntities[0]));

					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[0].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[0].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[1].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[1].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[2].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[2].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[0].figureImageList[3].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[3].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[0].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[4].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[1].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[5].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[2].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[6].imageUrl
					carDataListShowData[2].figureSubsetEntities[1].figureImageEntities[1].figureImageList[3].imageUrl = carDataListShowList[2].figureSubsetEntities[1].figureImageEntities[7].imageUrl
					
					carDataListShowData[3] = JSON.parse(JSON.stringify(carDataListShowList[3]));
					carDataListShowData[4] = JSON.parse(JSON.stringify(carDataListShowList[4]));
					carDataListShowData[5] = JSON.parse(JSON.stringify(carDataListShowList[5]));
					carDataListShowData[6] = JSON.parse(JSON.stringify(carDataListShowList[6]));
					carDataListShowData[7] = JSON.parse(JSON.stringify(carDataListShowList[7]));
					carDataListShowData[8] = JSON.parse(JSON.stringify(carDataListShowList[8]));
					carDataListShowData[9] = JSON.parse(JSON.stringify(carDataListShowList[9]));
				}


				this.carDataListShow = JSON.parse(JSON.stringify(carDataListShowData))
			}
			
		})
	}
	// 添加车辆类型示例图提交
	itemModalSubmit(modal) {
		var obj;

		var carDataListShowList = JSON.parse(JSON.stringify(this.carDataListShow));
		var carDataListShowData = []
		if(this.rowUseTypeL2 != '0213'){
			for(var i=0;i< carDataListShowList.length;i++){
				for(var j=0;j<carDataListShowList[i].figureSubsetEntities.length;j++){
					var figureImageList = [];
					// for(var k=0;k< carDataListShowList[i].figureSubsetEntities[j].figureImageEntities.length;k++){
					if(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[0].figureImageList){
						
						for(var a=0;a< carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[0].figureImageList.length;a++){
							figureImageList.push(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[0].figureImageList[a])
						}

						if(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[1] && carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[1].figureImageList){
						
							for(var b=0;b< carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[1].figureImageList.length;b++){
								figureImageList.push(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[1].figureImageList[b])
							}

							if(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[2] && carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[2].figureImageList){
							
								for(var c=0;c< carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[2].figureImageList.length;c++){
									figureImageList.push(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[2].figureImageList[c])
								}

								if(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[3] && carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[3].figureImageList){
								
									for(var d=0;d< carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[3].figureImageList.length;d++){
										figureImageList.push(carDataListShowList[i].figureSubsetEntities[j].figureImageEntities[3].figureImageList[d])
									}

									carDataListShowList[i].figureSubsetEntities[j].figureImageEntities = figureImageList
								}else{
									carDataListShowList[i].figureSubsetEntities[j].figureImageEntities = figureImageList
								}
							}else{
								carDataListShowList[i].figureSubsetEntities[j].figureImageEntities = figureImageList
							}
							
						}else{
							carDataListShowList[i].figureSubsetEntities[j].figureImageEntities = figureImageList
						}
						
					}
				}
			}
			carDataListShowData = carDataListShowList
		}else{
			carDataListShowData = carDataListShowList
		}

		console.log(carDataListShowData)
		if(this.formType == '编辑'){
			obj ={
				useTypeL2: this.rowUseTypeL2,
				useTypeL1: '02',
				figureInfo: JSON.stringify(carDataListShowData),
				type: '2',
				id: this.rowId
			}
		}else if(this.formType == '新增'){
			obj ={
				useTypeL2: this.rowUseTypeL2,
				useTypeL1: '02',
				figureInfo: JSON.stringify(carDataListShowData),
				type: '1'
			}
		}
		this.jsonApiService.http_obj("figure/modifyFigure.html", obj).subscribe(data => {
			this.jsonApiService.message(data.message);
			if(data.success){
				this.carDataListShow = [];
				this.rowId = ''
				this.tableParam.carType = ''
				this.load();
			}
			modal.hide();
		})
	}
	// 添加车辆类型示例图关闭
	itemModalClose(modal) {
		modal.hide();
	}
	//显示图片组件
	viewer: any='';
	fileList: File = null;
	fileChange(files: FileList,itemIndex,listIndex,valueIndex,valueImgIndex){
		if(this.isViewer && $(".viewer-container").length >0){
			this.viewer.destroy();
		}
		if(files.length == 0){
			return
		}
		var that = this;
		let multfileList = files;
		
        var reqdata = new FormData();
		reqdata.append('describe',this.carDataListShow[itemIndex].figureSubsetEntities[listIndex].figureImageEntities[valueIndex].name);
		
		reqdata.append('businessType', '3');
		// reqdata.append('type', '1');  //type 1获取相对路径  2获取绝对路径
		reqdata.append('type', '2'); //type 1获取相对路径  2获取绝对路径

		for(var i=0;i<multfileList.length;i++){
			this.fileList = multfileList[i];
			const isJPG = this.fileList.type === 'image/jpeg'|| this.fileList.type === 'image/jpg'|| this.fileList.type === 'image/png';
			if (!isJPG) {
			this.jsonApiService.message('上传图片只能是 png, jpg, jpeg 格式!');
			return;
			}

			reqdata.append('files',multfileList[i]);
			
		}
		

		that.jsonApiService.form_http("fileUpload/upload.html",reqdata).subscribe(data=> {
			// that.jsonApiService.message(data.message);
			if(data.success){
				if(valueImgIndex != '' || valueImgIndex === 0){
					this.carDataListShow[itemIndex].figureSubsetEntities[listIndex].figureImageEntities[valueIndex].figureImageList[valueImgIndex].imageUrl = data.data[0]
				}else{
					this.carDataListShow[itemIndex].figureSubsetEntities[listIndex].figureImageEntities[valueIndex].imageUrl = data.data[0]
				}
				
			}
		})
		
	}


	bigImgClick(){
		// modal.show();
		if(this.isViewer && $(".viewer-container").length >0){
			System.import('assets/js/viewer/viewer.js').then(
				()=>{System.import('assets/js/viewer/bootstrap.bundle.min.js').then(
					()=>{System.import('assets/js/viewer/viewer.css').then(()=>{
						this.showImg();
					})
				})
			})
		}else{
			this.showImg();
		}
	}
	showImg(){
		var that = this;
		var imgList
		imgList = $(".imageShowList")[0];
		this.viewer = new Viewer(imgList, {
			url: 'src',
			title: function (image) {
				return image.alt + ' (' + (this.index + 1) + '/' + this.length + ')' ; 
			},
		});
		that.isViewer = true
	}
}